package com.settlement.system.common.enums;


import com.settlement.system.common.util.common.EnumUtil;

/**
 * 描述: 字段枚举 <br>
 *
 * @author: hc <br>
 * 创建时间: 2022.07.26 10:45 <br>
 * <br>
 */
public enum FieldNameEnum implements Code<String>{
    /** 0:店发-发货数量 */DF_SEND_QTY("店发-发货数量","--@dfSendQty"),
    /** 1:店发-发货金额 */DF_SEND_AMOUNT("店发-发货金额","--@dfSendAmount"),
    /** 2:店发-一退数量 */DF_FIRST_RETURN_QTY("店发-一退数量 ","--@dfFirstReturnQty"),
    /** 3:店发-一退金额 */DF_FIRST_RETURN_AMOUNT("店发-一退金额 ","--@dfFirstReturnAmount"),
    /** 4:店发-三退退供返还数量 */DF_THREE_RETURN_BACK_QTY("店发-三退退供返还数量 ","--@dfThreeReturnBackQty"),
    /** 5:店发-三退退供返还金额 */DF_THREE_RETURN_BACK_AMOUNT("店发-三退退供返还金额 ","--@dfThreeReturnBackAmount"),
    /** 6:店发-三退数量 */DF_THREE_RETURN_QTY("店发-三退数量 ","--@dfThreeReturnQty"),
    /** 7:店发-三退金额 */DF_THREE_RETURN_AMOUNT("店发-三退金额 ","--@dfThreeReturnAmount"),
    /** 8:仓发-发货数量 */CF_SEND_QTY("仓发-发货数量","--@cfSendQty"),
    /** 9:仓发-发货金额 */CF_SEND_AMOUNT("仓发-发货金额","--@cfSendAmount"),
    /** 10:仓发-一退数量 */CF_FIRST_RETURN_QTY("仓发-一退数量 ","--@cfFirstReturnQty"),
    /** 11:仓发-一退金额 */CF_FIRST_RETURN_AMOUNT("仓发-一退金额 ","--@cfFirstReturnAmount"),
    /** 12:仓发-三退退供返还数量 */CF_THREE_RETURN_BACK_QTY("仓发-三退退供返还数量 ","--@cfThreeReturnBackQty"),
    /** 13:仓发-三退退供返还金额 */CF_THREE_RETURN_BACK_AMOUNT("仓发-三退退供返还金额 ","--@cfThreeReturnBackAmount"),
    /** 14:仓发-三退数量 */CF_THREE_RETURN_QTY("仓发-三退数量 ","--@cfThreeReturnQty"),
    /** 15:仓发-三退金额 */CF_THREE_RETURN_AMOUNT("仓发-三退金额 ","--@cfThreeReturnAmount"),
    /** 16:条件_【INT-发退货明细】_[只取126状态店铺的数据] */
    INT_SEND_RETURN_126_DATA_RANGE("条件_【INT-发退货明细】_[只取126状态店铺的数据]","--@intOnly126Data"),
    /** 17:条件_【INT-发退货明细】_[只取126状态店铺的数据]_退货 */
    INT_SEND_RETURN_126_DATA_RANGE_RETURN("条件_【INT-发退货明细】_[只取126状态店铺的数据]_退货","--@intOnly126DataReturn"),
    /** 18:条件_【INT-发退货明细】_[只取发退货数据] */
    INT_SEND_RETURN_SEND_RETURN_DATA_RANGE("条件_【INT-发退货明细】_[只取发退货数据]","--@intOnlySrData"),
    /** 19:条件_【INT-发退货明细】_[只取发退货数据]_退货 */
    INT_SEND_RETURN_SEND_RETURN_DATA_RANGE_RETURN("条件_【INT-发退货明细】_[只取发退货数据]_退货","--@intOnlySrDataReturn"),
    ;
    /**
     * 名称
     */
    private final String code;
    /**
     * replaceKey
     */
    private final String replaceKey;

    FieldNameEnum(String code, String replaceKey) {
        this.code = code;
        this.replaceKey = replaceKey;
    }

    public String getReplaceKey() {
        return replaceKey;
    }

    public static String getCodeByReplaceKey(String replaceKey) {
        FieldNameEnum[] values=FieldNameEnum.values();
        for (FieldNameEnum value : values) {
            if(value.getReplaceKey().equals(replaceKey.trim())){
                return value.code();
            }
        }
        return null;
    }
    /**
     * 获取对应的 ReportValueEnum
     * @param code code
     * @return 报表取值字段枚举
     */
    public static FieldNameEnum witch(String code){
        return EnumUtil.witch(code, FieldNameEnum.class,null);
    }


    @Override
    public String code() {
        return code;
    }
}
